<?php session_start();
include ("../model/connect.php");
include ("../model/Faculty/Faculty_class.php");

$regid = $_POST['id'];
$studentid = $_POST['studentid'];
$classid = $_POST['classid'];


$faculty = new Faculty();
if(empty($regid))
  {
    $_SESSION["appro-error"] = "<script>alert(\"Bạn chưa chọn môn nào để chấp nhận !!!\");</script>";
    header("location:http:/educational/faculty-index.php?p=faculty-list-course-appro&studentid=".$studentid."&classid=".$classid);
  }
  else
  {
    $N = count($regid);
    for($i=0; $i < $N; $i++)
    {
      $faculty->approCourse($regid[$i]);
    }
mysql_close($conn);
header("location:http:/educational/faculty-index.php?p=faculty-list-student&studentid=".$studentid."&classid=".$classid);
}
?>